#ifndef RIVIATHREADINTERFACE_H
#define RIVIATHREADINTERFACE_H

class QMutex;
class QThreadPool;
#include <functional>
#include "RIVIACommon_global.h"

#define THREAD_NUM 4

class RIVIAThreadInterface
{

public:
    static RIVIAThreadInterface* getInstance();
    void runFunction(std::function<void(void)> runEntry);
    void releaseThreads();
private:
    RIVIAThreadInterface();
private:
    static QThreadPool m_ThreadPool;
    static RIVIAThreadInterface* m_pInstance;
    static QMutex m_lockMutex;
};

void RIVIACOMMONSHARED_EXPORT RUN_FUNCTION_USE_THREAD(std::function<void(void)> runEntry);

#endif // RIVIATHREADINTERFACE_H
